home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Checking for a file => Does it exist (Help)
- Date: Thu, 18 Jan 96 01:10:47 GMT
- Organization: none
- Message-ID: <821927447snz@genesis.demon.co.uk>
- References: <4d9k6fINNnja@faatcrl.faa.gov> <4dc6kq$dja@gryphon.phoenix.net> <613O-oOMnTB@softsite.co.at>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <613O-oOMnTB@softsite.co.at>
- wsog@softsite.co.at "Walter Sommergruber" writes:
-
- >What is if the file exists but you have not the right to read it ?
-
- Since C has no concept of permissions you're always going to hit this
- problem when the environment implements them.
-
- >The fopen would fail but the file exists.
-
- >I know the non-portable ways with fstat (DOS, Unix) but is there
- >a portable way to tell if the file exists ?
-
- No. For instance what if the file was in a directory you couldn't inspect?
-
- The usual conclusion is that the question 'does a file exist' isn't generally
- useful. 'Can I perform such-and-such operation on a file' generally makes
- more sense.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-